/**
 * Created by Administrator on 2016/5/9.
 */
var express = require('express');
var app = express();

// 请求card时，返回一个JSON对象
app.get('/card', function (req, res) {
    var card = {name:'Grommash Hellscream', cost:8, attack:4, life:9};
    res.send(card);
});

// 请求根路径时，重定向到/card
app.get('/', function (req, res) {
    res.redirect(301, '/card');
});

app.listen(3001, function () {
   console.log('Server is running at 3001...');
});

